package com.dz.mapper;

import com.github.pagehelper.Page;
import com.dz.annotation.AutoFill;
import com.dz.dto.DishPageQueryDTO;
import com.dz.entity.Dish;
import com.dz.enumeration.OperationType;
import com.dz.vo.DishVO;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * @author 鄧浩奇
 * @classname DishMapper
 * @description
 * @since 2023/12/20 21:44
 **/

@Mapper
public interface DishMapper {

    List<Dish> selectByCategoryId(Long categoryId);

    Page<DishVO> getPage(DishPageQueryDTO queryDTO);

    Dish selectDishById(Long id);

    @AutoFill(OperationType.UPDATE)
    Integer update(Dish dish);

    @AutoFill(OperationType.INSERT)
    Integer insert(Dish dish);

    Integer deleteBatch(List<Long> ids);

    @AutoFill(OperationType.UPDATE)
    void changeStatus(Dish dish);

    Integer isIntoSetmeal(Long id);

    List<DishVO> selectDishVoByCategoryId(Long categoryId);
}
